/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.flexengine.engine;

import java.io.Serializable;

/**
 * @author Luann R. Athayde
 * @version 1.0
 * @since 1.0
 */
public enum Priority implements Serializable {

    CUSTOM_PRIORITY(-1),
    LOW_PRIORITY(0),
    NORMAL_PRIORITY(1),
    HIGH_PRIORITY(2);

    private int val;
    private Priority(int val) {
        this.val = val;
    }
    /**
     * Get the value of the priority...
     * @return val
     */
    public int getVal() {
        return val;
    }
    /**
     * Avaliable only for custom priority and you can change just one time.
     * @param val 0 >= val <= MAX_INT
     * @return 
     */
    public Priority setVal(int val) {
        if( this.val >= 3 ) {
            this.val = val;
        } else {
            this.val = -1;
        }
        return this;
    }
    
}